Shared coding conventions allow teams to collaborate efficiently. This rule checks that all local, final
, initialized, primitive
variables, have names that match a provided regular expression.
Noncompliant code example
With the default regular expression ^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$
:
public void doSomething() {
final int local = 42;
...
}
Compliant solution
public void doSomething() {
final int LOCAL = 42;
...
}